﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace OMSService
{
    [DataContract]
    public class ItemModel
    {
        int id;
        string name;
        string description;
        decimal price;
        int quantity;

        public ItemModel() { }

        public ItemModel(string name, string description, decimal price, int quantity)
        {
            Name = name;
            Description = description;
            Price = price;
            Quantity = quantity;
        }

        public ItemModel(Item item)
        {
            Id = item.Id;
            Name = item.Name;
            Description = item.Description;
            Price = item.Price;
            Quantity = item.Quantity;
        }

#region setters
        [DataMember]
        public int Id 
        {
            get { return id; }
            private set { id = value; } 
        }

        [DataMember]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        [DataMember]
        public string Description 
        {
            get { return description; }
            set { description = value; }
        }

        [DataMember]
        public decimal Price
        {
            get { return price; }
            set { price = value; }
        }

        [DataMember]
        public int Quantity 
        {
            get { return quantity; }
            set { quantity = value; }
        }
    }
#endregion
}